import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class CardDemo extends StatefulWidget {
  const CardDemo({Key? key}) : super(key: key);

  @override
  _CardDemoState createState() => _CardDemoState();
}

class _CardDemoState extends State<CardDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Card"),
      ),
      body: SingleChildScrollView(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Container(
            child: Column(
              children: [
                Card(
                  child: Padding(
                    padding: EdgeInsets.all(10),
                    child: Container(
                      width: 200,
                      height: 200,
                      decoration: BoxDecoration(
                          image: DecorationImage(
                              fit: BoxFit.cover,
                              image: NetworkImage(
                                  "https://img2.baidu.com/it/u=359180179,383614417&fm=26&fmt=auto"))),
                    ),
                  ),
                ),
                SizedBox(
                  height: 10,
                ),
                Card(
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(10),
                  ),
                  clipBehavior: Clip.antiAlias,
                  child: AspectRatio(
                    aspectRatio: 16 / 9,
                    child: Image.network(
                      "https://img2.baidu.com/it/u=359180179,383614417&fm=26&fmt=auto",
                      fit: BoxFit.cover,
                    ),
                  ),
                ),
                SizedBox(
                  height: 10,
                ),
                Card(
                  child: Column(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      ListTile(
                        title: Text("The Enchanted Nightingale"),
                        subtitle:
                            Text("Music by Julie Gable. Lyrics by Sidney Stein."),
                        leading: Icon(Icons.album),
                      ),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.end,
                        children: [
                          TextButton(
                              onPressed: () {},
                              child: Text(
                                "BUY TICKETS",
                                style: TextStyle(color: Colors.green),
                              )),
                          SizedBox(
                            width: 9,
                          ),
                          TextButton(
                              onPressed: () {},
                              child: Text(
                                "LISTEN",
                                style: TextStyle(color: Colors.blue),
                              )),
                          SizedBox(
                            width: 9,
                          ),
                        ],
                      )
                    ],
                  ),
                ),
                SizedBox(
                  height: 15,
                ),
                Card(
                  child: InkWell(
                    splashColor: Colors.blue.withAlpha(30),
                    onTap: () {},
                    child: SizedBox(
                      width: 300,
                      height: 100,
                      child: Center(
                        child: Text(
                          "A card that can be tapped",
                          textAlign: TextAlign.center,
                        ),
                      ),
                    ),
                  ),
                )
              ],
            ),
          ),
        ),
      ),
    );
  }
}
